<div class="content_wrapper">
  <div class="content_wrapper_inner">
<h4><?php echo $this->lang->line('pnr');?>: <span style="color: red; font-size:14px;"><?php echo $pnr;?></span></h4>
<br />
<?php if ($sale != 0) {?><span style="color: red; font-size:12px;">Biletleme için opsiyon süreniz: <?php echo $this->session->userdata('time_limit');?><br><br></span><?php }?>
<div class="showBox">
		<h5><?php echo $this->lang->line('passengers');?></h5><br>
		<table class="passengers">
			<thead>
				<tr align="left">
					<th width="70"><?php echo $this->lang->line('name');?></th>
					<th width="70"><?php echo $this->lang->line('surname');?></th>
					<?php if ($sale == 0) {?>
					<th width="100"><?php echo $this->lang->line('ticket_number');?></th>
					<?php }?>
				</tr>
			</thead>
			<tbody>
			<?php
			if ($sale == 0) {
				$query = $this->db->get_where('tickets', array('pnr' => $pnr));
				foreach ($query->result() as $row)
				{?>
				    <tr>
						<td><?php echo $row->NAME;?></td>
						<td ><?php echo $row->SURNAME;?></td>
						<td><?php echo $row->TICKETNUMBER; echo strlen($row->CONJUNCTIONS)==3?('-'.$row->CONJUNCTIONS):''; ?></td>
					</tr>
			<?php }
			} else {
				$passengers=$pnr_xml->xpath('//Passenger');
				foreach($passengers as $passenger) {?>
				    <tr>
						<td><?php echo $passenger->name;?></td>
						<td><?php echo $passenger->surname;?></td>
					</tr> 
			<?php }
			} ?>
			</tbody>
		</table>
		</div><br>

		<div class="showBox" id="itinirary">
		<h5><?php echo $this->lang->line('itinirary');?></h5><br>
		<div style="margin-left:-14px; padding-top:6px;">
		<table class="tb_available" style="width:675px;">
			<thead>
			</thead>
			<tbody>
			<td  class="miniTable"><?php echo $this->lang->line('flight');?></td>
				<td class="miniTable"><?php echo $this->lang->line('from');?></td>
				<td class="miniTable"><?php echo $this->lang->line('to');?></td>
				<td  class="miniTable"><?php echo $this->lang->line('date');?></td>
				<td  class="miniTable"><?php echo $this->lang->line('take_off');?></td>
				<td  class="miniTable"><?php echo $this->lang->line('landing');?></td>
				<td  class="miniTable"><?php echo $this->lang->line('cabin');?></td>
			<?php
			$segments = $pnr_xml->xpath('//segment');
			foreach($segments as $segment) {?>
				<tr>
					<td  class="miniTable2"><?php echo $segment->flightNumber;?></td>
					<td  class="miniTable2"><?php echo $segment->from;?></td>
					<td  class="miniTable2"><?php echo $segment->to;?></td>
					<td  class="miniTable2"><?php echo $segment->date;?></td>
					<td  class="miniTable2"><?php echo $segment->departureTime;?></td>
					<td  class="miniTable2"><?php echo $segment->arrivalTime;?></td>
					<td  class="miniTable2"><?php echo $segment->cabin;?></td>
				</tr>
				<?php }?>
			</tbody>
		</table></div>
		</div><br>
		<?php if ($sale == 0) {?>

			<div id="payment" class="showBox">
			<h5><?php echo $this->lang->line('payment_information');?></h5><br>
			<table>
			<tr>
				<td width="160"><strong><?php echo $this->lang->line('charged_amount');?> : </strong></td>
				<td> <span style="font-weight:bold; color:green; font-size:12px;"><?php echo $this->session->userdata('total_fare');?></span> TL</td>
			</tr>
			<tr>
				<td><strong><?php echo $this->lang->line('order_id');?> : </strong></td>
				<td> <?php echo $order_id;?></td>
			</tr>
			<tr>
				<td><strong><?php echo $this->lang->line('authroization_code');?> : </strong></td>
				<td> <?php echo $auth_code;?></td>
			</tr>
			</table>
			</div>
		<?php }?>
	</div>
</div>